<?php

namespace apiend\controllers;

use Yii;
use yii\rest\Controller;
use apiend\models\forms\AuthorizationForm;

/**
 * 接口授权
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class AuthorizeController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * 接口授权
     * @return mixed
     */
    public function actionIndex() {
        $model = new AuthorizationForm();
        $model->load(Yii::$app->request->post(), '');
        return $model->authorize();
    }

}
